\hypertarget{kdtree_8h}{
\section{C:/Users/Matt/Documents/School/Robotics/zebulon/v2/vision/ext/SIFT/kdtree.h File Reference}
\label{kdtree_8h}\index{C:/Users/Matt/Documents/School/Robotics/zebulon/v2/vision/ext/SIFT/kdtree.h@{C:/Users/Matt/Documents/School/Robotics/zebulon/v2/vision/ext/SIFT/kdtree.h}}
}
{\ttfamily \#include \char`\"{}cxcore.h\char`\"{}}\par
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structkd__node}{kd\_\-node}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structkd__node}{kd\_\-node} $\ast$ \hyperlink{kdtree_8h_ab07c8d9793fd9e7105f679127d12ee3c}{kdtree\_\-build} (struct \hyperlink{structfeature}{feature} $\ast$features, int n)
\item 
int \hyperlink{kdtree_8h_a730e01f100a477780a3ad55b32c3067b}{kdtree\_\-bbf\_\-knn} (struct \hyperlink{structkd__node}{kd\_\-node} $\ast$kd\_\-root, struct \hyperlink{structfeature}{feature} $\ast$feat, int k, struct \hyperlink{structfeature}{feature} $\ast$$\ast$$\ast$nbrs, int max\_\-nn\_\-chks)
\item 
int \hyperlink{kdtree_8h_aeaf077b151e1233a37d8d2dfcde7206e}{kdtree\_\-bbf\_\-spatial\_\-knn} (struct \hyperlink{structkd__node}{kd\_\-node} $\ast$kd\_\-root, struct \hyperlink{structfeature}{feature} $\ast$feat, int k, struct \hyperlink{structfeature}{feature} $\ast$$\ast$$\ast$nbrs, int max\_\-nn\_\-chks, CvRect rect, int model)
\item 
void \hyperlink{kdtree_8h_a9ef04232d0a4352e304f8eb93d22a949}{kdtree\_\-release} (struct \hyperlink{structkd__node}{kd\_\-node} $\ast$kd\_\-root)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Functions and structures for maintaining a k-\/d tree database of image features.

For more information, refer to:

Beis, J. S. and Lowe, D. G. Shape indexing using approximate nearest-\/neighbor search in high-\/dimensional spaces. In {\itshape Conference on Computer Vision and Pattern Recognition (CVPR)\/} (2003), pp. 1000-\/-\/1006.

Copyright (C) 2006 Rob Hess $<$\href{mailto:hess@eecs.oregonstate.edu}{\tt hess@eecs.oregonstate.edu}$>$

\begin{DoxyVersion}{Version}
1.1.1-\/20070913 
\end{DoxyVersion}


\subsection{Function Documentation}
\hypertarget{kdtree_8h_a730e01f100a477780a3ad55b32c3067b}{
\index{kdtree.h@{kdtree.h}!kdtree\_\-bbf\_\-knn@{kdtree\_\-bbf\_\-knn}}
\index{kdtree\_\-bbf\_\-knn@{kdtree\_\-bbf\_\-knn}!kdtree.h@{kdtree.h}}
\subsubsection[{kdtree\_\-bbf\_\-knn}]{\setlength{\rightskip}{0pt plus 5cm}int kdtree\_\-bbf\_\-knn (struct {\bf kd\_\-node} $\ast$ {\em kd\_\-root}, \/  struct {\bf feature} $\ast$ {\em feat}, \/  int {\em k}, \/  struct {\bf feature} $\ast$$\ast$$\ast$ {\em nbrs}, \/  int {\em max\_\-nn\_\-chks})}}
\label{kdtree_8h_a730e01f100a477780a3ad55b32c3067b}
Finds an image feature's approximate k nearest neighbors in a kd tree using Best Bin First search.


\begin{DoxyParams}{Parameters}
\item[{\em kd\_\-root}]root of an image \hyperlink{structfeature}{feature} kd tree \item[{\em feat}]image \hyperlink{structfeature}{feature} for whose neighbors to search \item[{\em k}]number of neighbors to find \item[{\em nbrs}]pointer to an array in which to store pointers to neighbors in order of increasing descriptor distance \item[{\em max\_\-nn\_\-chks}]search is cut off after examining this many tree entries\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Returns the number of neighbors found and stored in {\itshape nbrs\/}, or -\/1 on error. 
\end{DoxyReturn}
\hypertarget{kdtree_8h_aeaf077b151e1233a37d8d2dfcde7206e}{
\index{kdtree.h@{kdtree.h}!kdtree\_\-bbf\_\-spatial\_\-knn@{kdtree\_\-bbf\_\-spatial\_\-knn}}
\index{kdtree\_\-bbf\_\-spatial\_\-knn@{kdtree\_\-bbf\_\-spatial\_\-knn}!kdtree.h@{kdtree.h}}
\subsubsection[{kdtree\_\-bbf\_\-spatial\_\-knn}]{\setlength{\rightskip}{0pt plus 5cm}int kdtree\_\-bbf\_\-spatial\_\-knn (struct {\bf kd\_\-node} $\ast$ {\em kd\_\-root}, \/  struct {\bf feature} $\ast$ {\em feat}, \/  int {\em k}, \/  struct {\bf feature} $\ast$$\ast$$\ast$ {\em nbrs}, \/  int {\em max\_\-nn\_\-chks}, \/  CvRect {\em rect}, \/  int {\em model})}}
\label{kdtree_8h_aeaf077b151e1233a37d8d2dfcde7206e}
Finds an image feature's approximate k nearest neighbors within a specified spatial region in a kd tree using Best Bin First search.


\begin{DoxyParams}{Parameters}
\item[{\em kd\_\-root}]root of an image \hyperlink{structfeature}{feature} kd tree \item[{\em feat}]image \hyperlink{structfeature}{feature} for whose neighbors to search \item[{\em k}]number of neighbors to find \item[{\em nbrs}]pointer to an array in which to store pointers to neighbors in order of increasing descriptor distance \item[{\em max\_\-nn\_\-chks}]search is cut off after examining this many tree entries \item[{\em rect}]rectangular region in which to search for neighbors \item[{\em model}]if true, spatial search is based on kdtree features' model locations; otherwise it is based on their image locations\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Returns the number of neighbors found and stored in {\itshape nbrs\/} (in case {\itshape k\/} neighbors could not be found before examining {\itshape max\_\-nn\_\-checks\/} keypoint entries). 
\end{DoxyReturn}
\hypertarget{kdtree_8h_ab07c8d9793fd9e7105f679127d12ee3c}{
\index{kdtree.h@{kdtree.h}!kdtree\_\-build@{kdtree\_\-build}}
\index{kdtree\_\-build@{kdtree\_\-build}!kdtree.h@{kdtree.h}}
\subsubsection[{kdtree\_\-build}]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf kd\_\-node}$\ast$ kdtree\_\-build (struct {\bf feature} $\ast$ {\em features}, \/  int {\em n})\hspace{0.3cm}{\ttfamily  \mbox{[}read\mbox{]}}}}
\label{kdtree_8h_ab07c8d9793fd9e7105f679127d12ee3c}
A function to build a k-\/d tree database from keypoints in an array.


\begin{DoxyParams}{Parameters}
\item[{\em features}]an array of features \item[{\em n}]the number of features in {\itshape features\/} \end{DoxyParams}
\begin{DoxyReturn}{Returns}
Returns the root of a kd tree built from {\itshape features\/}. 
\end{DoxyReturn}
\hypertarget{kdtree_8h_a9ef04232d0a4352e304f8eb93d22a949}{
\index{kdtree.h@{kdtree.h}!kdtree\_\-release@{kdtree\_\-release}}
\index{kdtree\_\-release@{kdtree\_\-release}!kdtree.h@{kdtree.h}}
\subsubsection[{kdtree\_\-release}]{\setlength{\rightskip}{0pt plus 5cm}void kdtree\_\-release (struct {\bf kd\_\-node} $\ast$ {\em kd\_\-root})}}
\label{kdtree_8h_a9ef04232d0a4352e304f8eb93d22a949}
De-\/allocates memory held by a kd tree


\begin{DoxyParams}{Parameters}
\item[{\em kd\_\-root}]pointer to the root of a kd tree \end{DoxyParams}
